home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BMUG PD-ROM B4
/
PD-ROM B4.iso
/
Entertainment
/
Strategy
/
Robots
/
bot 1.0.1
/
Tutorial
/
BASIC
/
Seeker
< prev
next >
Wrap
Text File
|
1991-07-19
|
1KB
|
42 lines
!
! Seeker
!
! This bot scans around in a circle until it finds another bot.
! It locks on to the bot, firing until the enemy bot leaves the
! arc of the scanner. Then it resumes scanning.
!
#DATA
DEF scanAt ! Current scan angle
EQU INCREMENT 7 ! Amount to add to scan angle each time
#CODE BASIC
:Initialize
scanAt = Random(360) ! Start at a random angle
:ScanLoop
scanAt = scanAt + INCREMENT
Scan Angle scanAt
If ($FOUND == 0) Then Goto ScanLoop
! $FOUND == 0 means that nothing was
! found.
! ... so continue around in a circle
! ... otherwise, go on to ScanLock
:ScanLock
Fire Weapon 1, & ! Fire the (primary) weapon
Angle $ANGLE ! At the angle returned by the scanner.
! The '&' allows you to continue a line
! of code on the next line.
Scan Angle scanAt ! Check to see if enemy is still there
If ($FOUND == 0) Then
Goto ScanLoop ! If not, resume scanning
Goto ScanLock ! If so, keep firing until he dies or
! moves.
#END